package com.kingsailor.gunsmith.admin.web.servlet;

import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.stereotype.Component;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;

/**
 * @author xulixin
 */
@Component
public class ResourceLoaderServletRegister implements ServletContextInitializer {

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        ServletRegistration registration = servletContext.addServlet("configResourceLoaderServlet",
                ConfigResourceLoaderServlet.class);
        registration.addMapping("/static/config.js");
    }
}
